package org.dreamwork.cai.proxy;

import java.lang.reflect.Proxy;

/**
 * Created by IntelliJ IDEA.
 * User: seth.yang
 * Date: 12-9-4
 * Time: 上午12:40
 */
public class JDKProxyFactory {
    public static Object createProxy (Object target, Class<?>... interfaces) {
        if (target == null) return null;
        JDKProxyHandler handler = new JDKProxyHandler (target);
        return Proxy.newProxyInstance (target.getClass ().getClassLoader (), interfaces, handler);
    }
}